<template>
  <div>
    <span>公路情况</span>
    <el-form :inline="true" :model="formInline" class="demo-form-inline">
      <el-form-item label="满足率">
        <el-input v-model="formInline.logsatisfy" placeholder="满足率"></el-input>
      </el-form-item>
      <el-form-item label="数据变化">
        <el-select v-model="formInline.logsatisfyshift" placeholder="上升/下降/不变">
          <el-option label="上升" value="1"></el-option>
          <el-option label="下降" value="2"></el-option>
          <el-option label="不变" value="3"></el-option>
        </el-select>
      </el-form-item>
      <el-form-item label="创建日期">
        <el-date-picker type="date" placeholder="选择日期" v-model="formInline.creatDate" style="width: 100%;"></el-date-picker>
      </el-form-item>
      <br>
      <el-form-item label="价格">
        <el-input v-model="formInline.price" placeholder="价格"></el-input>
      </el-form-item>
      <el-form-item label="价格变化">
        <el-select v-model="formInline.priceshift" placeholder="上升/下降/不变">
          <el-option label="上升" value="1"></el-option>
          <el-option label="下降" value="2"></el-option>
          <el-option label="不变" value="3"></el-option>
        </el-select>
      </el-form-item>
      <el-form-item label="变动原因">
        <el-input v-model="formInline.logchange" placeholder="变动原因"></el-input>
      </el-form-item>
    </el-form>

    <span>铁路情况</span>
    <el-form :inline="true" :model="railway" class="demo-form-inline">
      <el-form-item label="满足率">
        <el-input v-model="railway.logsatisfy" placeholder="满足率"></el-input>
      </el-form-item>
      <el-form-item label="数据变化">
        <el-select v-model="railway.logsatisfyshift" placeholder="上升/下降/不变">
          <el-option label="上升" value="1"></el-option>
          <el-option label="下降" value="2"></el-option>
          <el-option label="不变" value="3"></el-option>
        </el-select>
      </el-form-item>
      <el-form-item label="创建日期">
        <el-date-picker type="date" placeholder="选择日期" v-model="railway.creatDate" style="width: 100%;"></el-date-picker>
      </el-form-item>
      <br>
      <el-form-item label="价格">
        <el-input v-model="railway.price" placeholder="价格"></el-input>
      </el-form-item>
      <el-form-item label="价格变化">
        <el-select v-model="railway.priceshift" placeholder="上升/下降/不变">
          <el-option label="上升" value="1"></el-option>
          <el-option label="下降" value="2"></el-option>
          <el-option label="不变" value="3"></el-option>
        </el-select>
      </el-form-item>
      <el-form-item label="变动原因">
        <el-input v-model="railway.logchange" placeholder="变动原因"></el-input>
      </el-form-item>
    </el-form>

    <span>水运情况</span>
    <el-form :inline="true" :model="waterWay" class="demo-form-inline">
      <el-form-item label="满足率">
        <el-input v-model="waterWay.logsatisfy" placeholder="满足率"></el-input>
      </el-form-item>
      <el-form-item label="数据变化">
        <el-select v-model="waterWay.logsatisfyshift" placeholder="上升/下降/不变">
          <el-option label="上升" value="1"></el-option>
          <el-option label="下降" value="2"></el-option>
          <el-option label="不变" value="3"></el-option>
        </el-select>
      </el-form-item>
      <el-form-item label="创建日期">
        <el-date-picker type="date" placeholder="选择日期" v-model="waterWay.creatDate" style="width: 100%;"></el-date-picker>
      </el-form-item>
      <br>
      <el-form-item label="价格">
        <el-input v-model="waterWay.price" placeholder="价格"></el-input>
      </el-form-item>
      <el-form-item label="价格变化">
        <el-select v-model="waterWay.priceshift" placeholder="上升/下降/不变">
          <el-option label="上升" value="1"></el-option>
          <el-option label="下降" value="2"></el-option>
          <el-option label="不变" value="3"></el-option>
        </el-select>
      </el-form-item>
      <el-form-item label="变动原因">
        <el-input v-model="waterWay.logchange" placeholder="变动原因"></el-input>
      </el-form-item>
    </el-form>

    <span>航运情况</span>
    <el-form :inline="true" :model="shipWay" class="demo-form-inline">
      <el-form-item label="满足率">
        <el-input v-model="shipWay.logsatisfy" placeholder="满足率"></el-input>
      </el-form-item>
      <el-form-item label="数据变化">
        <el-select v-model="shipWay.logsatisfyshift" placeholder="上升/下降/不变">
          <el-option label="上升" value="1"></el-option>
          <el-option label="下降" value="2"></el-option>
          <el-option label="不变" value="3"></el-option>
        </el-select>
      </el-form-item>
      <el-form-item label="创建日期">
        <el-date-picker type="date" placeholder="选择日期" v-model="shipWay.creatDate" style="width: 100%;"></el-date-picker>
      </el-form-item>
      <br>
      <el-form-item label="价格">
        <el-input v-model="shipWay.price" placeholder="价格"></el-input>
      </el-form-item>
      <el-form-item label="价格变化">
        <el-select v-model="shipWay.priceshift" placeholder="上升/下降/不变">
          <el-option label="上升" value="1"></el-option>
          <el-option label="下降" value="2"></el-option>
          <el-option label="不变" value="3"></el-option>
        </el-select>
      </el-form-item>
      <el-form-item label="变动原因">
        <el-input v-model="shipWay.logchange" placeholder="变动原因"></el-input>
      </el-form-item>
    </el-form>

    <span>其他情况</span>
    <el-form :inline="true" :model="otherWay" class="demo-form-inline">
      <el-form-item label="满足率">
        <el-input v-model="otherWay.logsatisfy" placeholder="满足率"></el-input>
      </el-form-item>
      <el-form-item label="数据变化">
        <el-select v-model="otherWay.logsatisfyshift" placeholder="上升/下降/不变">
          <el-option label="上升" value="1"></el-option>
          <el-option label="下降" value="2"></el-option>
          <el-option label="不变" value="3"></el-option>
        </el-select>
      </el-form-item>
      <el-form-item label="创建日期">
        <el-date-picker type="date" placeholder="选择日期" v-model="otherWay.creatDate" style="width: 100%;"></el-date-picker>
      </el-form-item>
      <br>
      <el-form-item label="价格">
        <el-input v-model="otherWay.price" placeholder="价格"></el-input>
      </el-form-item>
      <el-form-item label="价格变化">
        <el-select v-model="otherWay.priceshift" placeholder="上升/下降/不变">
          <el-option label="上升" value="1"></el-option>
          <el-option label="下降" value="2"></el-option>
          <el-option label="不变" value="3"></el-option>
        </el-select>
      </el-form-item>
      <el-form-item label="变动原因">
        <el-input v-model="otherWay.logchange" placeholder="变动原因"></el-input>
      </el-form-item>
    </el-form>

    <el-form>
      <el-form-item>
        <el-button type="primary" @click="onSubmit">确定填报</el-button>
      </el-form-item>
    </el-form>
  </div>
</template>

<script>
export default {
  data() {
    return {
      formInline: {
        logchange:'',
        logsatisfy:'',
        logsatisfyshift:'',
        creatDate:'',
        price:'',
        priceshift:'',
        logisticsoption: 1,
      },
      railway: {
        logchange:'',
        logsatisfy:'',
        logsatisfyshift:'',
        creatDate:'',
        price:'',
        priceshift:'',
        logisticsoption: 2,
      },
      waterWay: {
        logchange:'',
        logsatisfy:'',
        logsatisfyshift:'',
        creatDate:'',
        price:'',
        priceshift:'',
        logisticsoption: 3,
      },
      shipWay: {
        logchange:'',
        logsatisfy:'',
        logsatisfyshift:'',
        creatDate:'',
        price:'',
        priceshift:'',
        logisticsoption: 4,
      },
      otherWay: {
        logchange:'',
        logsatisfy:'',
        logsatisfyshift:'',
        creatDate:'',
        price:'',
        priceshift:'',
        logisticsoption: 5,
      },
    }
  },
  methods: {
    onSubmit() {
      const _this = this
      console.log(_this.formInline)
      axios.post('http://localhost:8081/log/logAdd',_this.formInline).then(function (resp){

      })
      axios.post('http://localhost:8081/log/logAdd',_this.railway).then(function (resp){

      })
      axios.post('http://localhost:8081/log/logAdd',_this.waterWay).then(function (resp){

      })
      axios.post('http://localhost:8081/log/logAdd',_this.shipWay).then(function (resp){

      })
      axios.post('http://localhost:8081/log/logAdd',_this.otherWay).then(function (resp){

      })
      alert("填报成功")
      _this.$router.push("/logistics")
    }
  }
}
</script>

<style scoped>
.span1{
  position: absolute;
  margin-top: 80px;
  margin-left: -800px;
}
</style>